package com.jinke.api.modules.app.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

@Getter
public enum QuestionType {

    LOGISTICS_STATUS(0, "物流状态"),

    CUSTOMS_ISSUES(1, "海关问题"),

    GENERAL_ISSUES(2, "通用问题"),
    BILL_RELATED_ISSUES(3, "账单相关问题"),
    RETURNS(4, "退件"),
    PICK_UP_THE_ITEM(5, "取件"),
    ADDRESS_MODIFICATION(6, "地址修改"),
    OPERATION_DEMONSTRATION_APPOINTMENT(7, "操作演示预约"),
    TECHNICAL_SUPPORT(8, "技术支持"),
    OTHER_ISSUES(9, "其他问题"),
    MATERIAL_ORDERING(10, "物资订购"),
    ACCOUNT_ISSUES(11, "账户问题"),
    COMPLAIN(12, "投诉"),

    ;

    @EnumValue
    private final int value;
    private final String desc;

    QuestionType(final int value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    @JsonValue
    public int getValue() {
        return this.value;
    }

    public static String getDescFromValue(int value) {
        for (QuestionType type : QuestionType.values()) {
            if (type.getValue() == value) {
                return type.getDesc();
            }
        }
        return "未找到对应的描述";
    }

}